package com.pro.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.Objects;

/**
 * ClassName:JsUserCouponUsed
 * Package:com.pro.pojo
 * Description: 优惠券使用记录表
 *
 * @Date:2022/1/13 下午 8:28
 * @Author: WYH
 */
public class JsUserCouponUsed {

    private Integer usedId;//优惠券使用记录主键id
    private Integer couponId;//优惠券主键
    private Integer userId;//用户id
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date useDate;//使用时间
    private String orderId;//订单id
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date getDate;//获取时间
    private String remarks;//1.已使用 2.未使用

    public JsUserCouponUsed() {
    }

    public JsUserCouponUsed(Integer usedId, Integer couponId, Integer userId, Date useDate, String orderId, Date getDate, String remarks) {
        this.usedId = usedId;
        this.couponId = couponId;
        this.userId = userId;
        this.useDate = useDate;
        this.orderId = orderId;
        this.getDate = getDate;
        this.remarks = remarks;
    }

    public void setUsedId(Integer usedId) {
        this.usedId = usedId;
    }

    public void setCouponId(Integer couponId) {
        this.couponId = couponId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public void setUseDate(Date useDate) {
        this.useDate = useDate;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public void setGetDate(Date getDate) {
        this.getDate = getDate;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public Integer getUsedId() {
        return usedId;
    }

    public Integer getCouponId() {
        return couponId;
    }

    public Integer getUserId() {
        return userId;
    }

    public Date getUseDate() {
        return useDate;
    }

    public String getOrderId() {
        return orderId;
    }

    public Date getGetDate() {
        return getDate;
    }

    public String getRemarks() {
        return remarks;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        JsUserCouponUsed that = (JsUserCouponUsed) o;
        return Objects.equals(usedId, that.usedId) &&
                Objects.equals(couponId, that.couponId) &&
                Objects.equals(userId, that.userId) &&
                Objects.equals(useDate, that.useDate) &&
                Objects.equals(orderId, that.orderId) &&
                Objects.equals(getDate, that.getDate) &&
                Objects.equals(remarks, that.remarks);
    }

    @Override
    public int hashCode() {
        return Objects.hash(usedId, couponId, userId, useDate, orderId, getDate, remarks);
    }

    @Override
    public String toString() {
        return "JsUserCouponUsed{" +
                "usedId=" + usedId +
                ", couponId=" + couponId +
                ", userId=" + userId +
                ", useDate=" + useDate +
                ", orderId='" + orderId + '\'' +
                ", getDate=" + getDate +
                ", remarks='" + remarks + '\'' +
                '}';
    }
}
